<!DOCTYPE html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <script src="./js/vue.js"></script>
    <script src="./js/element-ui.js"></script>
    <link rel="stylesheet" href="./js/element-ui.css">
    <script src="./js/axios.js"></script>
    <style>
        body {
            background-color: rgb(141, 190, 233);
        }

        #app {
            width: 80%;
            background-color: rgb(112, 204, 231);
            border: 4px solid blueviolet;
            border-radius: 1em;
            box-shadow: 3px, 3px, 3px rgba(0, 0, 0, 0.5);
            padding: 3em;
            margin: 20px auto;

        }

        h3 {
            text-align: center;
        }

        .title {
            display: flex;
            justify-content: space-between;
            align-items: center;
            border: 1px solid rgb(20, 17, 17);
            padding: 0 1em;
        }

        .title h4 {
            line-height: 2;
            margin: 0;
        }
    </style>
</head>

<body>
    <div id="app">
        <h3>大数据2032名单遍历</h3>
        <div class="title">
            <h4>XXXX</h4>
            <span @click="click1()">
                {{isOK ? '收起' : '展开'}}
            </span>
        </div>

        <div v-show="isOK">
            <el-table :data="tableData">
                <el-table-column prop="num" label="学号" width="230">
                </el-table-column>
                <el-table-column prop="name" label="姓名" width="230">
                </el-table-column>
                <el-table-column prop="sex" label="性别" width="230">
                </el-table-column>
            </el-table>


        </div>
    </div>
    <script>
        var vm = new Vue({
            el: '#app',
            data() {
                return {
                    isOK: false,
                    tableData: []
                }
            },
            methods: {
                click1() {
                    this.isOK = !this.isOK;

                },
                async findAllCategory(){
                    // axios.defaults.baseURL='http://39.103.160.49:8888';
                    var result = await axios({
                        url:'../2032echarts/js/data2032.js',
                        methods:'get'

                    })
                    console.log(result.data);
                    this.tableData = result.data;

                },
                async findAllCategory(){
                    await axios.get("../2032echarts/js/data2032.js").then(result=>{
                        console.log(result.data);
                        this.tableData = result.data;
                    })
                }

            },
            created() {
                this.findAllCategory();

            }
        })
    </script>
</body>

</html>